package com.yjs.app.trade.core.base.exception;

/**
 * 错误信息
 * 
 * @author hikaru
 * @since 1.0.0
 */
public class Error {

	/**
	 * 错误编码
	 */
	private String code;

	/**
	 * 错误描述
	 */
	private String remark;
	
	
	public Error() {}
	
	public Error(Exception e) {
		if (e instanceof BusinessException) {
			code = ((BusinessException) e).getErrorCode();
			remark = ((BusinessException) e).getMessage();
		} else {
			code = "SYSTEM_ERROR";
			remark = "系统错误";
		}
	}
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
